<?php

namespace App\Http\Requests\Admin\brand;

use App\Http\Requests\Request;

class UpdateRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        $rules =  [
            'brand_name' => 'required',
            'cat_id' => 'exists:category,cat_id',
        ];
        return $rules;

    }

    /**
     * 验证信息
     * @return array
     */

    public function messages()
    {
        return [
            'brand_name.required'  => '请填写品牌名称',
            'cat_id.exists' => '所选商品分类不存在',

        ];
    }
}
